<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>事故详情管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		function addRow(list, idx, tpl, row){
			$(list).append(Mustache.render(tpl, {
				idx: idx, delBtn: true, row: row
			}));
			$(list+idx).find("select").each(function(){
				$(this).val($(this).attr("data-value"));
			});
			$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
				var ss = $(this).attr("data-value").split(',');
				for (var i=0; i<ss.length; i++){
					if($(this).val() == ss[i]){
						$(this).attr("checked","checked");
					}
				}
			});
		}
		function delRow(obj, prefix){
			var id = $(prefix+"_id");
			var delFlag = $(prefix+"_delFlag");
			if (id.val() == ""){
				$(obj).parent().parent().remove();
			}else if(delFlag.val() == "0"){
				delFlag.val("1");
				$(obj).html("&divide;").attr("title", "撤销删除");
				$(obj).parent().parent().addClass("error");
			}else if(delFlag.val() == "1"){
				delFlag.val("0");
				$(obj).html("&times;").attr("title", "删除");
				$(obj).parent().parent().removeClass("error");
			}
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/accident/accident/">事故详情列表</a></li>
		<li class="active"><a href="${ctx}/accident/accident/form?id=${accident.id}">事故详情<shiro:hasPermission name="accident:accident:edit">${not empty accident.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="accident:accident:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="accident" action="${ctx}/accident/accident/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">事故场景：</label>
			<div class="controls">
				<table id="contentTable" class="table table-striped table-bordered table-condensed">
					<tr>
					<td>
							认字编号：
						</td>
						<td>
							<form:input path="accidentno" htmlEscape="false" maxlength="50" class="input"/>
						</td>
						<td>
							事故状态：
						</td>
						<td>
							<form:select path="status" class="input" Disabled="true">
								<form:option value="" label=""/>
								<form:options items="${fns:getDictList('mas_case_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							</form:select>
						</td>
						<td>
							事故发生时间：
						</td>
						<td>
							<input name="accidentdatetime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${accident.accidentdatetime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
				<span class="help-inline"><font color="red">*</font> </span>
						</td>
						
					</tr>
				</table>
			</div>
				
			</div>
		
		<div class="control-group">
			<label class="control-label">事故事实：</label>
			<div class="controls">
				<form:textarea path="accidentinfo" htmlEscape="false" rows="4" maxlength="50" class="input-xxlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注：</label>
			<div class="controls">
				<form:textarea path="remark" htmlEscape="false" rows="4" class="input-xxlarge "/>
			</div>
		</div>
			<div class="control-group">
				<label class="control-label">事故车辆表：</label>
				<div class="controls">
					<table id="contentTable" class="table table-striped table-bordered table-condensed">
						<thead>
							<tr>
								<th class="hide"></th>
								<th>号牌种类</th>
								<th>号牌号码</th>
								<th>车辆中文品牌</th>
								<th>车辆型号</th>
								<th>车辆英文品牌</th>
								<th>国产/进口</th>
								<th>车辆识别代号</th>
								<th>车辆发动机号</th>
								<th>车辆类型</th>
								<th>车身颜色</th>
								<th>使用性质</th>
								<th>机动车所有人</th>
								<th>身份证明号码</th>
								<th>身份证明名称</th>
								<th>联系电话</th>
								<th>住所行政区划</th>
								<th>住所详细地址</th>
								<th>所有权</th>
								<th>最近定检日期</th>
								<th>检验有效期止</th>
								<th>强制报废期止</th>
								<th>机动车状态</th>
								<th>行驶方向</th>
								<th>保险凭证号</th>
								<th>保险公司</th>
								<th>承担责任</th>
								<th>法律ID</th>
								<shiro:hasPermission name="accident:accident:edit"><th width="10">&nbsp;</th></shiro:hasPermission>
							</tr>
						</thead>
						<tbody id="accidentcarList">
						</tbody>
						<shiro:hasPermission name="accident:accident:edit"><tfoot>
							<tr><td colspan="29"><a href="javascript:" onclick="addRow('#accidentcarList', accidentcarRowIdx, accidentcarTpl);accidentcarRowIdx = accidentcarRowIdx + 1;" class="btn">新增</a></td></tr>
						</tfoot></shiro:hasPermission>
					</table>
					<script type="text/template" id="accidentcarTpl">//<!--
						<tr id="accidentcarList{{idx}}">
							<td class="hide">
								<input id="accidentcarList{{idx}}_id" name="accidentcarList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="accidentcarList{{idx}}_delFlag" name="accidentcarList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td>
								<select id="accidentcarList{{idx}}_hpzl" name="accidentcarList[{{idx}}].hpzl" data-value="{{row.hpzl}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_car_type')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<select id="accidentcarList{{idx}}_hphm" name="accidentcarList[{{idx}}].hphm" data-value="{{row.hphm}}" class="input-small required">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_cardno_head')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_clzwpp" name="accidentcarList[{{idx}}].clzwpp" type="text" value="{{row.clzwpp}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_clxh" name="accidentcarList[{{idx}}].clxh" type="text" value="{{row.clxh}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_clywpp" name="accidentcarList[{{idx}}].clywpp" type="text" value="{{row.clywpp}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_gcjk" name="accidentcarList[{{idx}}].gcjk" type="text" value="{{row.gcjk}}" maxlength="1" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_clsbdh" name="accidentcarList[{{idx}}].clsbdh" type="text" value="{{row.clsbdh}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_fdjh" name="accidentcarList[{{idx}}].fdjh" type="text" value="{{row.fdjh}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<select id="accidentcarList{{idx}}_cllx" name="accidentcarList[{{idx}}].cllx" data-value="{{row.cllx}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_quasi_driving')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_csys" name="accidentcarList[{{idx}}].csys" type="text" value="{{row.csys}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_syxz" name="accidentcarList[{{idx}}].syxz" type="text" value="{{row.syxz}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_syr" name="accidentcarList[{{idx}}].syr" type="text" value="{{row.syr}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_sfzmhm" name="accidentcarList[{{idx}}].sfzmhm" type="text" value="{{row.sfzmhm}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<select id="accidentcarList{{idx}}_sfzmmc" name="accidentcarList[{{idx}}].sfzmmc" data-value="{{row.sfzmmc}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_sfzmmc')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_lxdh" name="accidentcarList[{{idx}}].lxdh" type="text" value="{{row.lxdh}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_zsxzqh" name="accidentcarList[{{idx}}].zsxzqh" type="text" value="{{row.zsxzqh}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_zsxxdz" name="accidentcarList[{{idx}}].zsxxdz" type="text" value="{{row.zsxxdz}}" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_syq" name="accidentcarList[{{idx}}].syq" type="text" value="{{row.syq}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_djrq" name="accidentcarList[{{idx}}].djrq" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
									value="{{row.djrq}}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_yxqz" name="accidentcarList[{{idx}}].yxqz" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
									value="{{row.yxqz}}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_qzbfqz" name="accidentcarList[{{idx}}].qzbfqz" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
									value="{{row.qzbfqz}}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
							</td>
							<td>
								<select id="accidentcarList{{idx}}_zt" name="accidentcarList[{{idx}}].zt" data-value="{{row.zt}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_car_status')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<select id="accidentcarList{{idx}}_xsfx" name="accidentcarList[{{idx}}].xsfx" data-value="{{row.xsfx}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_direction')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_bxpz" name="accidentcarList[{{idx}}].bxpz" type="text" value="{{row.bxpz}}" maxlength="100" class="input-small "/>
							</td>
							<td>
								<select id="accidentcarList{{idx}}_bxgs" name="accidentcarList[{{idx}}].bxgs" data-value="{{row.bxgs}}" class="input-small required">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_BXGS')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<select id="accidentcarList{{idx}}_responsibility" name="accidentcarList[{{idx}}].responsibility" data-value="{{row.responsibility}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_responsibility')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<input id="accidentcarList{{idx}}_lawid" name="accidentcarList[{{idx}}].lawid" type="text" value="{{row.lawid}}" maxlength="20" class="input-small  digits"/>
							</td>
							<shiro:hasPermission name="accident:accident:edit"><td class="text-center" width="10">
								{{#delBtn}}<span class="close" onclick="delRow(this, '#accidentcarList{{idx}}')" title="删除">&times;</span>{{/delBtn}}
							</td></shiro:hasPermission>
						</tr>//-->
					</script>
					<script type="text/javascript">
						var accidentcarRowIdx = 0, accidentcarTpl = $("#accidentcarTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
						$(document).ready(function() {
							var data = ${fns:toJson(accident.accidentcarList)};
							for (var i=0; i<data.length; i++){
								addRow('#accidentcarList', accidentcarRowIdx, accidentcarTpl, data[i]);
								accidentcarRowIdx = accidentcarRowIdx + 1;
							}
						});
					</script>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">事故责任人表：</label>
				<div class="controls">
					<table id="contentTable" class="table table-striped table-bordered table-condensed">
						<thead>
							<tr>
								<th class="hide"></th>
								<th>档案编号</th>
								<th>准驾车型</th>
								<th>身份证明号码</th>
								<th>身份证明名称</th>
								<th>审验日期</th>
								<th>驾驶证有效期始</th>
								<th>驾驶证有效期止</th>
								<th>累积积分</th>
								<th>驾驶证状态</th>
								<th>驾驶员姓名</th>
								<th>驾驶员性别</th>
								<th>驾驶员联系电话</th>
								<th>驾证期限</th>
								<th>驾驶员住址所属区县</th>
								<th>驾驶员住址道路</th>
								<th>驾驶员住址详细</th>
								<shiro:hasPermission name="accident:accident:edit"><th width="10">&nbsp;</th></shiro:hasPermission>
							</tr>
						</thead>
						<tbody id="accidenterList">
						</tbody>
						<shiro:hasPermission name="accident:accident:edit"><tfoot>
							<tr><td colspan="18"><a href="javascript:" onclick="addRow('#accidenterList', accidenterRowIdx, accidenterTpl);accidenterRowIdx = accidenterRowIdx + 1;" class="btn">新增</a></td></tr>
						</tfoot></shiro:hasPermission>
					</table>
					<script type="text/template" id="accidenterTpl">//<!--
						<tr id="accidenterList{{idx}}">
							<td class="hide">
								<input id="accidenterList{{idx}}_id" name="accidenterList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="accidenterList{{idx}}_delFlag" name="accidenterList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td>
								<input id="accidenterList{{idx}}_dabh" name="accidenterList[{{idx}}].dabh" type="text" value="{{row.dabh}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<select id="accidenterList{{idx}}_zjcx" name="accidenterList[{{idx}}].zjcx" data-value="{{row.zjcx}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_quasi_driving')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<input id="accidenterList{{idx}}_sfzmhm" name="accidenterList[{{idx}}].sfzmhm" type="text" value="{{row.sfzmhm}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<select id="accidenterList{{idx}}_sfzmmc" name="accidenterList[{{idx}}].sfzmmc" data-value="{{row.sfzmmc}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_sfzmmc')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<input id="accidenterList{{idx}}_syrq" name="accidenterList[{{idx}}].syrq" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
									value="{{row.syrq}}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
							</td>
							<td>
								<input id="accidenterList{{idx}}_yxqs" name="accidenterList[{{idx}}].yxqs" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
									value="{{row.yxqs}}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
							</td>
							<td>
								<input id="accidenterList{{idx}}_yxqz" name="accidenterList[{{idx}}].yxqz" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
									value="{{row.yxqz}}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
							</td>
							<td>
								<input id="accidenterList{{idx}}_ljjf" name="accidenterList[{{idx}}].ljjf" type="text" value="{{row.ljjf}}" maxlength="11" class="input-small "/>
							</td>
							<td>
								<select id="accidenterList{{idx}}_zt" name="accidenterList[{{idx}}].zt" data-value="{{row.zt}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_drivinglicense_status')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<input id="accidenterList{{idx}}_xm" name="accidenterList[{{idx}}].xm" type="text" value="{{row.xm}}" maxlength="20" class="input-small "/>
							</td>
							<td>
								<c:forEach items="${fns:getDictList('area.id|name')}" var="dict" varStatus="dictStatus">
									<span><input id="accidenterList{{idx}}_xb${dictStatus.index}" name="accidenterList[{{idx}}].xb" type="radio" value="${dict.value}" data-value="{{row.xb}}"><label for="accidenterList{{idx}}_xb${dictStatus.index}">${dict.label}</label></span>
								</c:forEach>
							</td>
							<td>
								<input id="accidenterList{{idx}}_lxdh" name="accidenterList[{{idx}}].lxdh" type="text" value="{{row.lxdh}}" maxlength="255" class="input-small "/>
							</td>
							<td>
								<input id="accidenterList{{idx}}_jzqx" name="accidenterList[{{idx}}].jzqx" type="text" value="{{row.jzqx}}" maxlength="11" class="input-small "/>
							</td>
							<td>
								<sys:treeselect id="accidenterList{{idx}}_area" name="accidenterList[{{idx}}].area.id" value="{{row.area.id}}" labelName="accidenterList{{idx}}.area.name" labelValue="{{row.area.name}}"
									title="区域" url="/sys/area/treeData" cssClass="" allowClear="true" notAllowSelectParent="true"/>
							</td>
							<td>
								<input id="accidenterList{{idx}}_road" name="accidenterList[{{idx}}].road" type="text" value="{{row.road}}" maxlength="20" class="input-small "/>
							</td>
							<td>
								<input id="accidenterList{{idx}}_address" name="accidenterList[{{idx}}].address" type="text" value="{{row.address}}" maxlength="20" class="input-small "/>
							</td>
							<shiro:hasPermission name="accident:accident:edit"><td class="text-center" width="10">
								{{#delBtn}}<span class="close" onclick="delRow(this, '#accidenterList{{idx}}')" title="删除">&times;</span>{{/delBtn}}
							</td></shiro:hasPermission>
						</tr>//-->
					</script>
					<script type="text/javascript">
						var accidenterRowIdx = 0, accidenterTpl = $("#accidenterTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
						$(document).ready(function() {
							var data = ${fns:toJson(accident.accidenterList)};
							for (var i=0; i<data.length; i++){
								addRow('#accidenterList', accidenterRowIdx, accidenterTpl, data[i]);
								accidenterRowIdx = accidenterRowIdx + 1;
							}
						});
					</script>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">事故地点表：</label>
				<div class="controls">
					<table id="contentTable" class="table table-striped table-bordered table-condensed">
						<thead>
							<tr>
								<th class="hide"></th>
								<th>结构化地址信息</th>
								<th>区县名</th>
								<th>街道名</th>
								<th>街道门牌号</th>
								<th>位置说明</th>
								<th>当前天气</th>
								<!--<shiro:hasPermission name="accident:accident:edit"><th width="10">&nbsp;</th></shiro:hasPermission>-->
							</tr>
						</thead>
						<tbody id="accidentlocation">
						</tbody>
						<!--<shiro:hasPermission name="accident:accident:edit"><tfoot>
							<tr><td colspan="9"><a href="javascript:" onclick="addRow('#accidentlocation', accidentlocationRowIdx, accidentlocationTpl);accidentlocationRowIdx = accidentlocationRowIdx + 1;" class="btn">新增</a></td></tr>
						</tfoot></shiro:hasPermission>-->
					</table>
					<script type="text/template" id="accidentlocationTpl">//<!--
						<tr id="accidentlocation{{idx}}">
							<td class="hide">
								<input id="accidentlocation{{idx}}_id" name="accidentlocation[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="accidentlocation{{idx}}_delFlag" name="accidentlocation[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td>
								<input id="accidentlocation{{idx}}_accidentlocation" name="accidentlocation[{{idx}}].accidentlocation" type="text" value="{{row.accidentlocation}}" class="input-small "/>
							</td>
							<td>
								<sys:treeselect id="accidentlocation{{idx}}_area" name="accidentlocation[{{idx}}].area.id" value="{{row.area.id}}" labelName="accidentlocation{{idx}}.area.name" labelValue="{{row.area.name}}"
									title="区域" url="/sys/area/treeData" cssClass="" allowClear="true" notAllowSelectParent="true"/>
							</td>
							<td>
								<input id="accidentlocation{{idx}}_street" name="accidentlocation[{{idx}}].street" type="text" value="{{row.street}}" maxlength="200" class="input-small "/>
							</td>
							<td>
								<input id="accidentlocation{{idx}}_streetnumber" name="accidentlocation[{{idx}}].streetnumber" type="text" value="{{row.streetnumber}}" maxlength="200" class="input-small "/>
							</td>
							<td>
								<input id="accidentlocation{{idx}}_sematicdesription" name="accidentlocation[{{idx}}].sematicdesription" type="text" value="{{row.sematicdesription}}" class="input-small "/>
							</td>
							<td>
								<select id="accidentlocation{{idx}}_currentweather" name="accidentlocation[{{idx}}].currentweather" data-value="{{row.currentweather}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_weather')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<!--<shiro:hasPermission name="accident:accident:edit"><td class="text-center" width="10">
								{{#delBtn}}<span class="close" onclick="delRow(this, '#accidentlocation{{idx}}')" title="删除">&times;</span>{{/delBtn}}
							</td></shiro:hasPermission>-->
						</tr>//-->
					</script>
					<script type="text/javascript">
						var accidentlocationRowIdx = 0, accidentlocationTpl = $("#accidentlocationTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
						$(document).ready(function() {
							var data = ${fns:toJson(accident.accidentlocation)};
							for (var i=0; i<data.length; i++){
								addRow('#accidentlocation', accidentlocationRowIdx, accidentlocationTpl, data[i]);
								
								accidentlocationRowIdx = accidentlocationRowIdx + 1;
							}
						});
					</script>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">事故图片表：</label>
				<div class="controls">
					<table id="contentTable" class="table table-striped table-bordered table-condensed">
						<thead>
							<tr>
								<th class="hide"></th>
								<th>图片URL</th>
								<th>图片类型</th>
								<th>是否显示</th>
								<shiro:hasPermission name="accident:accident:edit"><th width="10">&nbsp;</th></shiro:hasPermission>
							</tr>
						</thead>
						<tbody id="accidentpicList">
						</tbody>
						<shiro:hasPermission name="accident:accident:edit"><tfoot>
							<tr><td colspan="5"><a href="javascript:" onclick="addRow('#accidentpicList', accidentpicRowIdx, accidentpicTpl);accidentpicRowIdx = accidentpicRowIdx + 1;" class="btn">新增</a></td></tr>
						</tfoot></shiro:hasPermission>
					</table>
					<script type="text/template" id="accidentpicTpl">//<!--
						<tr id="accidentpicList{{idx}}">
							<td class="hide">
								<input id="accidentpicList{{idx}}_id" name="accidentpicList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="accidentpicList{{idx}}_delFlag" name="accidentpicList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td>
								<input id="accidentpicList{{idx}}_picpath" name="accidentpicList[{{idx}}].picpath" type="hidden" value="{{row.picpath}}"/>
								<sys:ckfinder input="accidentpicList{{idx}}_picpath" type="images" uploadPath="/accident/accident" selectMultiple="true" maxWidth="100" maxHeight="100"/>
							</td>
							<td>
								<select id="accidentpicList{{idx}}_pictype" name="accidentpicList[{{idx}}].pictype" data-value="{{row.pictype}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_accident_pic')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<c:forEach items="${fns:getDictList('yes_no')}" var="dict" varStatus="dictStatus">
									<span><input id="accidentpicList{{idx}}_status${dictStatus.index}" name="accidentpicList[{{idx}}].status" type="radio" value="${dict.value}" data-value="{{row.status}}"><label for="accidentpicList{{idx}}_status${dictStatus.index}">${dict.label}</label></span>
								</c:forEach>
							</td>
							<shiro:hasPermission name="accident:accident:edit"><td class="text-center" width="10">
								{{#delBtn}}<span class="close" onclick="delRow(this, '#accidentpicList{{idx}}')" title="删除">&times;</span>{{/delBtn}}
							</td></shiro:hasPermission>
						</tr>//-->
					</script>
					<script type="text/javascript">
						var accidentpicRowIdx = 0, accidentpicTpl = $("#accidentpicTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
						$(document).ready(function() {
							var data = ${fns:toJson(accident.accidentpicList)};
							for (var i=0; i<data.length; i++){
								addRow('#accidentpicList', accidentpicRowIdx, accidentpicTpl, data[i]);
								accidentpicRowIdx = accidentpicRowIdx + 1;
							}
						});
					</script>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">事故结果表：</label>
				<div class="controls">
					<table id="contentTable" class="table table-striped table-bordered table-condensed">
						<thead>
							<tr>
								<th class="hide"></th>
								<th>调解结果</th>
								<th>事故详情</th>
								<th>归属管理大队</th>
								<!--<shiro:hasPermission name="accident:accident:edit"><th width="10">&nbsp;</th></shiro:hasPermission>-->
							</tr>
						</thead>
						<tbody id="accidentresult">
						</tbody>
						<!--<shiro:hasPermission name="accident:accident:edit"><tfoot>
							<tr><td colspan="6"><a href="javascript:" onclick="addRow('#accidentresult', accidentresultRowIdx, accidentresultTpl);accidentresultRowIdx = accidentresultRowIdx + 1;" class="btn">新增</a></td></tr>
						</tfoot></shiro:hasPermission>-->
					</table>
					<script type="text/template" id="accidentresultTpl">//<!--
						<tr id="accidentresult{{idx}}">
							<td class="hide">
								<input id="accidentresult{{idx}}_id" name="accidentresult[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="accidentresult{{idx}}_delFlag" name="accidentresult[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td>
								<select id="accidentresult{{idx}}_resultcontent" name="accidentresult[{{idx}}].resultcontent" data-value="{{row.resultcontent}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_mediation_results')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<select id="accidentresult{{idx}}_blame" name="accidentresult[{{idx}}].blame" data-value="{{row.blame}}" class="input-small ">
									<option value=""></option>
									<c:forEach items="${fns:getDictList('mas_blame')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td>
								<sys:treeselect id="accidentresult{{idx}}_office" name="accidentresult[{{idx}}].office.id" value="{{row.office.id}}" labelName="accidentresult{{idx}}.office.name" labelValue="{{row.office.name}}"
									title="部门" url="/sys/office/treeData?type=2" cssClass="" allowClear="true" notAllowSelectParent="true"/>
							</td>
							<!--<shiro:hasPermission name="accident:accident:edit"><td class="text-center" width="10">
								{{#delBtn}}<span class="close" onclick="delRow(this, '#accidentresult{{idx}}')" title="删除">&times;</span>{{/delBtn}}
							</td></shiro:hasPermission>-->
						</tr>//-->
					</script>
					<script type="text/javascript">
						var accidentresultRowIdx = 0, accidentresultTpl = $("#accidentresultTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
						$(document).ready(function() {
							var data = ${fns:toJson(accident.accidentresult)};
							for (var i=0; i<data.length; i++){
								addRow('#accidentresult', accidentresultRowIdx, accidentresultTpl, data[i]);
								accidentresultRowIdx = accidentresultRowIdx + 1;
							}
						});
					</script>
				</div>
			</div>
		<div class="form-actions">
			<shiro:hasPermission name="accident:accident:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>